package com.dc.refactoring._3_重新组织数据._3_ChangeValueToReference.newObject;

/**
 * Description: 将值对象改为引用对象_改造后订单类
 * @author: gdc
 * @date: 2020/11/16
 * @version 1.0
 */
public class Order {

    private Customer customer;

    public Order(String customerName) {
        // 【6】修改客户的引用方式
        this.customer = Customer.getNamed(customerName);
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(String customerName) {
        this.customer = Customer.getNamed(customerName);
    }

    public String getCustomerName() {
        return customer.getName();
    }
}
